angular.module('faApp')
  .service('varietyService', ['ajaxService', '$http', '$location', '$q', function(ajaxService, $http, $location, $q) {

    this.getNewProList = function(cfg) {
      return ajaxService.post(ajaxService.getApiUri("EXTERIOR_FETCH__PRO_LIST"), cfg || {});
    };
    this.getNewProInfo = function(id) {
      return ajaxService.post(ajaxService.getApiUri("EXTERIOR_FETCH__PRO_DETAIL"),{id : id});
    };
    this.getSfaProInfo = function(id) {
      return ajaxService.post(ajaxService.getApiUri("SFA__PRO_DETAIL"),{id : id});
    };

    this.giveUpFetchingPro = function(id) {
      return ajaxService.post(ajaxService.getApiUri("GIVEUP_PRO_CAPTURE"), { id: id });
    };

    this.noBindingProList = function(type) {
      return ajaxService.post(ajaxService.getApiUri("NO_BINDING_FETCH__PRO_LIST"), { pType: type });
    }
    this.yesBindingProList = function(cfg) {
      return ajaxService.post(ajaxService.getApiUri("YES_BINDING_FETCH__PRO_LIST"), cfg || {});
    }
    this.addBindingPro = function(cfg) {
      return ajaxService.post(ajaxService.getApiUri("ADD_BINDING"), cfg || {});
    }
    this.removeBindingPro = function(cfg) {
      return ajaxService.post(ajaxService.getApiUri("REMOVE_BINDING"), cfg || {});
    }
    this.updataProInfo = function(cfg) {
      return ajaxService.post(ajaxService.getApiUri("UPDATE__PRO_DETAIL"), cfg || {});
    }
    this.addNewPro = function(cfg) {
      return ajaxService.post(ajaxService.getApiUri("ADD_FETCH_PRO"), cfg || {});
    }
  }]);
